GtkFontButton: Limit the decimals shown for size
authorMatthias Clasen <mclasen@redhat.com>
Fri, 15 Aug 2014 19:09:45 +0000 (15:09 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 15 Aug 2014 19:09:45 +0000 (15:09 -0400)
It doesn't make sense to show a font size with 6 digits. Use
the same formatting we use in the font chooser widget now.

https://bugzilla.gnome.org/show_bug.cgi?id=724996

gtk/gtkfontbutton.c

index 22cca740ca01d9f1195ef49be9ce866dbf96fc00..cb0822f93eff7763836bea3ebbc8dd80b5740450 100644 (file)
@@ -1160,7 +1160,7 @@ gtk_font_button_update_font_info (GtkFontButton *font_button)
   if (font_button->priv->show_size) 
     {
       /* mirror Pango, which doesn't translate this either */
-      gchar *size = g_strdup_printf ("%g%s",
+      gchar *size = g_strdup_printf ("%2.4g%s",
                                      pango_font_description_get_size (priv->font_desc) / (double)PANGO_SCALE,
                                      pango_font_description_get_size_is_absolute (priv->font_desc) ? "px" : "");